package modele.contact;

import modele.adresse.Adresse;
import modele.mail.AdresseMail;


public class Personne{
		private String nom;
		private String prenom;
		private String civilites;
		private String numPort;
		private String numDom;
		private Adresse adresse;
		private AdresseMail sonMail;
		
		
		public Personne(String nom, String prenom, String civilites, String numPort, String numDom, Adresse adresse, AdresseMail sonMail) {
			super();
			this.nom = nom;
			this.prenom = prenom;
			this.civilites = civilites;
			this.numPort = numPort;
			this.numDom = numDom;
			this.adresse = adresse;
			this.sonMail = sonMail;
		}

		public String getNom() {
			return nom;
		}


		public void setNom(String nom) {
			this.nom = nom;
		}


		public String getPrenom() {
			return prenom;
		}


		public void setPrenom(String prenom) {
			this.prenom = prenom;
		}


		public String getCivilites() {
			return civilites;
		}


		public void setCivilites(String civilites) {
			this.civilites = civilites;
		}


		public String getNumPort() {
			return numPort;
		}


		public void setNumPort(String numPort) {
			this.numPort = numPort;
		}


		public String getNumDom() {
			return numDom;
		}


		public void setNumDom(String numDom) {
			this.numDom = numDom;
		}


		public Adresse getAdresse() {
			return adresse;
		}


		public void setAdresse(Adresse adresse) {
			this.adresse = adresse;
		}


		public AdresseMail getSonMail() {
			return sonMail;
		}


		public void setSonMail(AdresseMail sonMail) {
			this.sonMail = sonMail;
		}

		@Override
		public String toString() {
			return "Personne [nom=" + nom + ", prenom=" + prenom
					+ ", civilites=" + civilites + ", numPort=" + numPort
					+ ", numDom=" + numDom + ", adresse=" + adresse
					+ ", sonMail=" + sonMail + "]\n";
		}
		
		
		public String toString2() {
			return "nom=" + nom + ", prenom=" + prenom
					+ ", civilites=" + civilites + ", numPort=" + numPort
					+ ", numDom=" + numDom + ", adresse=" + adresse
					+ ", sonMail=" + sonMail;
		}
		
		@Override
		public boolean equals(Object obj) {
			if (this.getClass().toString().equalsIgnoreCase(obj.getClass().toString())){
				if(this.nom.equals(((Personne) obj).getNom()) 
				&& this.prenom.equals(((Personne) obj).getPrenom()) 
				&& this.civilites.equals(((Personne) obj).getCivilites()) 
				&& this.numPort.equals(((Personne) obj).getNumPort()) 
				&& this.numDom.equals(((Personne) obj).getNumDom()) 
				&& this.adresse.toString().equals(((Personne) obj).getAdresse().toString()) 
				&& this.sonMail.toString().equals(((Personne) obj).getSonMail().toString())) {
					return true;
				}
				else {
					return false;
				}
			}
			else {
				return false;
			}
		}
}
